<table>
    <tbody>

        <tr class="prop">
            <td class="name">
                <label for="username"><g:message code="user.username" default="Username" />:</label>
            </td>
            <td class="value ${hasErrors(bean: userInstance, field: 'username', 'errors')}">
                <g:textField name="username" maxlength="25" value="${fieldValue(bean: userInstance, field: 'username')}" />
            </td>
            <td class="name">&nbsp;</td>
            <td class="value">&nbsp;</td>
        </tr>

        <tr class="prop">
            <td class="name">
                <label for="roles"><g:message code="user.roles" default="Roles" />:</label>
            </td>
            <td class="value ${hasErrors(bean: userInstance, field: 'roles', 'errors')}">
                <g:select name="roles" from="${org.icress.fusion.shiro.Role.list()}" optionKey="id" optionValue="name" value="${userInstance?.roles?.toArray() }" />
            </td>
            <td class="name">
                <label for="profile"><g:message code="user.profile" default="Profile" />:</label>
            </td>
            <td class="value ${hasErrors(bean: userInstance, field: 'profile', 'errors')}">
                <g:select name="profile.id" from="${org.icress.fusion.admin.Profile.list()}" optionKey="id" optionValue="name" value="${userInstance?.profile?.id }" />
            </td>
        </tr>

        <tr class="prop">
            <td class="name">
                <label for="department"><g:message code="user.department" default="Department" />:</label>
            </td>
            <td class="value ${hasErrors(bean: userInstance, field: 'department', 'errors')}">
                <g:select name="department.id" from="${org.icress.fusion.b2b.Department.list()}" optionKey="id" optionValue="name" value="${userInstance?.department?.id }"
                    noSelection="['':'']"/>
            </td>
            <td class="name">
                <label for="group"><g:message code="user.group" default="Group" />:</label>
            </td>
            <td class="value ${hasErrors(bean: userInstance, field: 'group', 'errors')}">
                <g:select name="group.id" from="${org.icress.fusion.admin.Group.list()}" optionKey="id" optionValue="name" value="${userInstance?.group?.id }"
                    noSelection="['':'']"/>
            </td>
        </tr>
    </tbody>
</table>
